import 'package:app/constant/color.dart';
import 'package:flutter/material.dart';

import 'sign.page.dart';
import 'widget/button.widget.dart';
import 'widget/input.widget.dart';
import 'widget/Social.widget.dart';

class LoginPage extends StatelessWidget {
  LoginPage({super.key});

  final emailController = TextEditingController();
  final passwordController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: SingleChildScrollView(
          padding: const EdgeInsets.all(32.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              const SizedBox(height: 30),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    "Logo",
                    style: TextStyle(
                      fontSize: 30,
                      fontWeight: FontWeight.bold,
                      color: ThemeColors.mainColor,
                    ),
                  )
                ],
              ),
              const SizedBox(height: 50),
              Text(
                "Login to your Account",
                style: TextStyle(
                  fontSize: 18,
                  fontWeight: FontWeight.w400,
                  color: ThemeColors.textColor,
                ),
              ),
              const SizedBox(height: 20),
              InputWidget(
                controller: emailController,
                name: "Email",
                inputType: TextInputType.emailAddress,
              ),
              const SizedBox(height: 20),
              InputWidget(
                controller: passwordController,
                name: "Password",
                inputType: TextInputType.text,
                obscure: true,
              ),
              const SizedBox(height: 30),
              const ButtonWidget("Sign in"),
              const SizedBox(height: 40),
              Center(
                child: Text(
                  "- Or sign in with -",
                  style: TextStyle(
                    color: ThemeColors.textColor,
                  ),
                ),
              ),
              const SizedBox(height: 20),
              const SocialLogin(),
              const SizedBox(height: 50),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    "Don't have a account?",
                    style: TextStyle(
                      color: ThemeColors.textColor,
                    ),
                  ),
                  const SizedBox(width: 4),
                  InkWell(
                    child: Text(
                      "Sign up",
                      style: TextStyle(
                        color: ThemeColors.mainColor,
                      ),
                    ),
                    onTap: () {
                      Navigator.of(context).push(MaterialPageRoute(
                        builder: (context) => SignPage(),
                      ));
                    },
                  )
                ],
              ),
              const SizedBox(height: 20),
            ],
          ),
        ),
      ),
    );
  }
}
